package com.hangim.pce.common.search.repository;

import com.hangim.pce.common.search.domain.ESDrug;
import com.hangim.pce.common.search.domain.ESElement;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

public interface ESElementRepository extends ElasticsearchRepository<ESElement, Long> {
    @Query("{\"query_string\":{\"query\":\"?0\",\"fields\":[\"name\",\"nameAlias\",\"spell\"]}}")
    Page<ESElement> findElementForPage(String q, Pageable pageable);

}
